package com.xyz.dao.logic;

import com.free.ext.mybatis.model.entity.PageResponseModel;
import com.xyz.dao.dao.CAnnounceInfoDao;
import com.xyz.domain.table.CAnnounceInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CAnnounceInfoLogic {

    @Autowired
    private CAnnounceInfoDao cAnnounceInfoDao;

    public CAnnounceInfo add(CAnnounceInfo cAnnounceInfo){
        return cAnnounceInfoDao.insert(cAnnounceInfo);
    }

    public Integer update(CAnnounceInfo cAnnounceInfo){
        return cAnnounceInfoDao.update(cAnnounceInfo);
    }

    public List<CAnnounceInfo> list(CAnnounceInfo cAnnounceInfo, String orderBy){
        return cAnnounceInfoDao.selectList(cAnnounceInfo, orderBy);
    }

    public Integer delete(Integer key){
        return cAnnounceInfoDao.delete(key);
    }

    public PageResponseModel<CAnnounceInfo> pageInfo(CAnnounceInfo cAnnounceInfo, String orderBy, Integer pageNo, Integer pageSize){
        return cAnnounceInfoDao.selectByPageNo(cAnnounceInfo, orderBy, pageNo, pageSize);
    }

}